home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / impdes / dessin.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  5.2 KB  |  94 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "DEMONSTRATION"
  4.    ClientHeight    =   4425
  5.    ClientLeft      =   4140
  6.    ClientTop       =   1530
  7.    ClientWidth     =   7110
  8.    Height          =   4830
  9.    Left            =   4080
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4425
  12.    ScaleWidth      =   7110
  13.    Top             =   1185
  14.    Width           =   7230
  15.    Begin DirListBox Dir1 
  16.       Height          =   1830
  17.       Left            =   4710
  18.       TabIndex        =   3
  19.       Top             =   1500
  20.       Width           =   2055
  21.    End
  22.    Begin ComboBox Combo1 
  23.       Height          =   300
  24.       Left            =   4710
  25.       TabIndex        =   2
  26.       Text            =   "Combo1"
  27.       Top             =   810
  28.       Width           =   2055
  29.    End
  30.    Begin PictureBox Picture1 
  31.       Height          =   2835
  32.       Left            =   600
  33.       Picture         =   DESSIN.FRX:0000
  34.       ScaleHeight     =   2805
  35.       ScaleWidth      =   3465
  36.       TabIndex        =   1
  37.       Top             =   540
  38.       Width           =   3495
  39.    End
  40.    Begin CommandButton Command1 
  41.       Caption         =   "Impression"
  42.       Height          =   345
  43.       Left            =   5130
  44.       TabIndex        =   0
  45.       Top             =   3900
  46.       Width           =   1815
  47.    End
  48. '                                                                                                                                                                                                   '
  49. '                                                                                                                                                                                                    '
  50. 'Programme de d
  51. monstration de l'impression des fen
  52. tres sur une imprimante                                                                                                                           '
  53. '                                                                                                                                                                                                      '
  54. '                                                                                                                                                                                                       '
  55.     DefInt A-Z
  56.     Option Explicit
  57. Sub Command1_Click ()
  58.     Dim R As Integer
  59. '                                                                                                                                                                                                                               '
  60. '                                                                                                                                                                                                                                '
  61. 'Routine permettant d'effectuer les impressions                                                                                                                                                                                   '
  62. '                                                                                                                                                                                                                                  '
  63. '                                                                                                                                                                                                                                   '
  64.     'Initialisation de l'imprimante                                                                                                         '
  65.     Printer.ScaleMode = 3
  66.     Screen.MousePointer = 11
  67.     Printer.Print ""
  68.     'Dessin de la fen
  69. tre enti
  70. re avec les contours                                                                                                                                                                                                     '
  71.     R = PrintWindow(Printer.hDC, 100, 100, Printer.ScaleWidth - 200, Printer.ScaleHeight - 200, Form1.hWnd)
  72.     If Not R Then
  73.         MsgBox "Unable to print the form"
  74.         Exit Sub
  75.     End If
  76.     'Dessin de la fen
  77. tre enti
  78. re sans les contours                                                                                                                                                                                                     '
  79.     R = PrintClient(Printer.hDC, 100, 2000, Form1.hWnd, 4)
  80.     If Not R Then
  81.         MsgBox "Unable to print the form"
  82.         Exit Sub
  83.     End If
  84.     'Dessin du dessin uniquement                                                                                                                                                                                                     '
  85.     R = PrintClient(Printer.hDC, 100, 1650, Picture1.hWnd, 2)
  86.     If Not R Then
  87.         MsgBox "Unable to print the form"
  88.         Exit Sub
  89.     End If
  90.     'Fin de l'impression                                                                                                                                                                                                                        '
  91.     Printer.EndDoc
  92.     Screen.MousePointer = 0
  93. End Sub
  94.